package com.springcloud.first.client.controller;

import com.springcloud.first.client.pojo.Item;
import com.springcloud.first.client.pojo.JdbcConfigBean;
import com.springcloud.first.client.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class ItemController {


	@Autowired
	private ItemService itemService;
	
	@Autowired
	private JdbcConfigBean jdbcConfigBean;

	@GetMapping(value = "/item/{id}")
	public Item queryItemById(@PathVariable("id") Long id) {
		return this.itemService.queryItemById(id);
	}
	
	@GetMapping(value = "/test")
	public String test(){
		return this.jdbcConfigBean.toString();
	}


}
